<?php

require_once __DIR__ . '/../autoload.php';

//引入用户信息检查类
use src\DataBase;

$messageCount = 0;
$db = new DataBase\DataBaseOperate('139.196.124.180', 'school', 'user1', 'Mcx857264', 'utf8');
$newSelectMessage = $db->select('messageRelease', '*', null, 'messageReleaseTime');
$time = time() + 60 * 60 * 24 * 30 * 54;
setcookie("messageID", $newSelectMessage[0][0], $time);
?>
<!DOCTYPE html>
<html>
<head>
    <title>消息</title>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="description" content="Write an awesome description for your new site here">
    <link rel="stylesheet" href="css/weui.css">
    <link rel="stylesheet" href="https://cdn.bootcss.com/jquery-weui/1.2.0/css/jquery-weui.min.css">
    <link rel="stylesheet" href="css/demos.css">
    <link rel="stylesheet" href="https://cdn.bootcss.com/weui/0.4.3/style/weui.min.css" type="text/css">
</head>
<body ontouchstart>
<header class='demos-header' style="padding-top: 20px;padding-bottom: 20px;">
    <h1 class="demos-title">消息</h1>
</header>
<?php foreach ($newSelectMessage as $singleMessage) { ?>
    <div class="weui-form-preview">
        <div class="weui-form-preview__bd">
            <div class="weui-form-preview__item">
                <label class="weui-form-preview__label">发布内容</label>
                <em class="weui-form-preview__value" style="padding-right: 10px"><?php echo $singleMessage[1] ?></em>
            </div>
            <div class="weui-form-preview__item">
                <label class="weui-form-preview__label">发布时间</label>
                <em class="weui-form-preview__value" style="padding-right: 10px"><?php echo $singleMessage[2] ?></em>
            </div>
        </div>
    </div>
<?php } ?>
<script src="js/jquery-2.1.4.js"></script>
<script src="js/fastclick.js"></script>
<script>
    $(function () {
        FastClick.attach(document.body);
    });
</script>
<script src="https://cdn.bootcss.com/jquery-weui/1.2.0/js/jquery-weui.min.js"></script>
</body>
</html>
